home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / patches / ami301c.zip / QKPERC.SM$ / QKPERC.SMM
INI File  |  1993-05-15  |  22KB  |  1,758 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     
  5. [files]
  6. [charset]
  7.     82
  8.     ANSI (Windows, IBM CP 1252)
  9. [revisions]
  10.     0
  11. [prn]
  12.     QMS-PS 810
  13. [port]
  14.     LPT1:
  15. [lang]
  16.     1
  17. [desc]
  18.     Quickly calculate percentages for a series of numbers.
  19.     
  20.     
  21.     
  22.     
  23.     737501925
  24.     20
  25.     732310448
  26.     721
  27.     7
  28.     0
  29.     0
  30.     0
  31.     0
  32.     
  33.     
  34.     
  35.     
  36.     
  37.     
  38.     1
  39. [fopts]
  40.     0
  41.     1
  42.     0
  43.     0
  44. [lnopts]
  45.     2
  46.     Body Text
  47.     1
  48. [docopts]
  49.     5
  50.     2
  51. [GramStyle]
  52.     
  53. [ParaNum]
  54.     1
  55. [tag]
  56.     Body Text
  57.     2
  58.     [fnt]
  59.         Times New Roman
  60.         240
  61.         0
  62.         49152
  63.     [algn]
  64.         1
  65.         1
  66.         0
  67.         0
  68.         0
  69.     [spc]
  70.         33
  71.         273
  72.         1
  73.         0
  74.         0
  75.         1
  76.         100
  77.     [brk]
  78.         4
  79.     [line]
  80.         8
  81.         0
  82.         1
  83.         0
  84.         1
  85.         1
  86.         1
  87.         10
  88.         10
  89.         1
  90.     [spec]
  91.         0
  92.         0
  93.         
  94.         0
  95.         1
  96.         1
  97.         0
  98.         0
  99.         0
  100.         0
  101.     [nfmt]
  102.         280
  103.         1
  104.         2
  105.         .
  106.         ,
  107.         $
  108.     Body Text
  109.     0
  110.     0
  111. [tag]
  112.     Body Single
  113.     3
  114.     [fnt]
  115.         Times New Roman
  116.         240
  117.         0
  118.         49152
  119.     [algn]
  120.         1
  121.         1
  122.         0
  123.         0
  124.         0
  125.     [spc]
  126.         33
  127.         273
  128.         1
  129.         0
  130.         0
  131.         1
  132.         100
  133.     [brk]
  134.         4
  135.     [line]
  136.         8
  137.         0
  138.         1
  139.         0
  140.         1
  141.         1
  142.         1
  143.         10
  144.         10
  145.         1
  146.     [spec]
  147.         0
  148.         0
  149.         
  150.         0
  151.         1
  152.         1
  153.         0
  154.         0
  155.         0
  156.         0
  157.     [nfmt]
  158.         280
  159.         1
  160.         2
  161.         .
  162.         ,
  163.         $
  164.     Body Single
  165.     0
  166.     0
  167. [tag]
  168.     Bullet
  169.     4
  170.     [fnt]
  171.         Times New Roman
  172.         240
  173.         0
  174.         49152
  175.     [algn]
  176.         1
  177.         1
  178.         0
  179.         288
  180.         288
  181.     [spc]
  182.         33
  183.         273
  184.         1
  185.         0
  186.         0
  187.         1
  188.         100
  189.     [brk]
  190.         4
  191.     [line]
  192.         8
  193.         0
  194.         1
  195.         0
  196.         1
  197.         1
  198.         1
  199.         10
  200.         10
  201.         1
  202.     [spec]
  203.         0
  204.         0
  205.         <*0>
  206.         360
  207.         1
  208.         1
  209.         0
  210.         0
  211.         0
  212.         0
  213.     [nfmt]
  214.         272
  215.         1
  216.         2
  217.         .
  218.         ,
  219.         $
  220.     Bullet
  221.     0
  222.     0
  223. [tag]
  224.     Bullet 1
  225.     5
  226.     [fnt]
  227.         Times New Roman
  228.         240
  229.         0
  230.         49152
  231.     [algn]
  232.         1
  233.         1
  234.         288
  235.         288
  236.         288
  237.     [spc]
  238.         33
  239.         273
  240.         1
  241.         0
  242.         0
  243.         1
  244.         100
  245.     [brk]
  246.         4
  247.     [line]
  248.         8
  249.         0
  250.         1
  251.         0
  252.         1
  253.         1
  254.         1
  255.         10
  256.         10
  257.         1
  258.     [spec]
  259.         0
  260.         0
  261.         <*5>
  262.         0
  263.         1
  264.         1
  265.         0
  266.         0
  267.         0
  268.         0
  269.     [nfmt]
  270.         280
  271.         1
  272.         2
  273.         .
  274.         ,
  275.         $
  276.     Bullet 1
  277.     0
  278.     0
  279. [tag]
  280.     Number List
  281.     6
  282.     [fnt]
  283.         Times New Roman
  284.         240
  285.         0
  286.         49152
  287.     [algn]
  288.         1
  289.         1
  290.         360
  291.         360
  292.         360
  293.     [spc]
  294.         33
  295.         273
  296.         1
  297.         0
  298.         0
  299.         1
  300.         100
  301.     [brk]
  302.         4
  303.     [line]
  304.         8
  305.         0
  306.         1
  307.         0
  308.         1
  309.         1
  310.         1
  311.         10
  312.         10
  313.         1
  314.     [spec]
  315.         0
  316.         0
  317.         <*:>.
  318.         360
  319.         1
  320.         1
  321.         0
  322.         16
  323.         0
  324.         0
  325.     [nfmt]
  326.         272
  327.         1
  328.         2
  329.         .
  330.         ,
  331.         $
  332.     Number List
  333.     0
  334.     0
  335. [tag]
  336.     Subhead
  337.     7
  338.     [fnt]
  339.         Times New Roman
  340.         240
  341.         0
  342.         49155
  343.     [algn]
  344.         1
  345.         1
  346.         0
  347.         0
  348.         0
  349.     [spc]
  350.         33
  351.         273
  352.         1
  353.         72
  354.         72
  355.         1
  356.         100
  357.     [brk]
  358.         4
  359.     [line]
  360.         8
  361.         0
  362.         1
  363.         0
  364.         1
  365.         1
  366.         1
  367.         10
  368.         10
  369.         1
  370.     [spec]
  371.         0
  372.         2
  373.         
  374.         0
  375.         1
  376.         1
  377.         0
  378.         0
  379.         0
  380.         0
  381.     [nfmt]
  382.         272
  383.         1
  384.         2
  385.         .
  386.         ,
  387.         $
  388.     Subhead
  389.     0
  390.     0
  391. [tag]
  392.     Title
  393.     8
  394.     [fnt]
  395.         Arial
  396.         360
  397.         0
  398.         16385
  399.     [algn]
  400.         4
  401.         1
  402.         0
  403.         0
  404.         0
  405.     [spc]
  406.         33
  407.         446
  408.         1
  409.         144
  410.         72
  411.         1
  412.         100
  413.     [brk]
  414.         16
  415.     [line]
  416.         8
  417.         0
  418.         1
  419.         0
  420.         1
  421.         1
  422.         1
  423.         10
  424.         10
  425.         1
  426.     [spec]
  427.         0
  428.         1
  429.         
  430.         0
  431.         1
  432.         1
  433.         0
  434.         0
  435.         0
  436.         0
  437.     [nfmt]
  438.         272
  439.         1
  440.         2
  441.         .
  442.         ,
  443.         $
  444.     Title
  445.     0
  446.     0
  447. [tag]
  448.     Header
  449.     9
  450.     [fnt]
  451.         Times New Roman
  452.         240
  453.         0
  454.         49152
  455.     [algn]
  456.         1
  457.         1
  458.         0
  459.         0
  460.         0
  461.     [spc]
  462.         33
  463.         273
  464.         1
  465.         0
  466.         0
  467.         1
  468.         100
  469.     [brk]
  470.         4
  471.     [line]
  472.         8
  473.         0
  474.         1
  475.         0
  476.         1
  477.         1
  478.         1
  479.         10
  480.         10
  481.         1
  482.     [spec]
  483.         0
  484.         0
  485.         
  486.         0
  487.         1
  488.         1
  489.         0
  490.         0
  491.         0
  492.         0
  493.     [nfmt]
  494.         280
  495.         1
  496.         2
  497.         .
  498.         ,
  499.         $
  500.     Header
  501.     0
  502.     0
  503. [tag]
  504.     Footer
  505.     11
  506.     [fnt]
  507.         Times New Roman
  508.         240
  509.         0
  510.         49152
  511.     [algn]
  512.         1
  513.         1
  514.         0
  515.         0
  516.         0
  517.     [spc]
  518.         33
  519.         273
  520.         1
  521.         0
  522.         0
  523.         1
  524.         100
  525.     [brk]
  526.         4
  527.     [line]
  528.         8
  529.         0
  530.         1
  531.         0
  532.         1
  533.         1
  534.         1
  535.         10
  536.         10
  537.         1
  538.     [spec]
  539.         0
  540.         0
  541.         
  542.         0
  543.         1
  544.         1
  545.         0
  546.         0
  547.         0
  548.         0
  549.     [nfmt]
  550.         280
  551.         1
  552.         2
  553.         .
  554.         ,
  555.         $
  556.     Footer
  557.     0
  558.     0
  559. [lay]
  560.     Standard
  561.     513
  562.     [rght]
  563.         15840
  564.         12240
  565.         1
  566.         1440
  567.         1440
  568.         1
  569.         1440
  570.         1440
  571.         0
  572.         1
  573.         0
  574.         1
  575.         0
  576.         2
  577.         1
  578.         1440
  579.         10800
  580.         12
  581.         1
  582.         720
  583.         1
  584.         1440
  585.         1
  586.         2160
  587.         1
  588.         2880
  589.         1
  590.         3600
  591.         1
  592.         4320
  593.         1
  594.         5040
  595.         1
  596.         5760
  597.         1
  598.         6480
  599.         1
  600.         7200
  601.         1
  602.         7920
  603.         1
  604.         8640
  605.     [hrght]
  606.     [lyfrm]
  607.         1
  608.         11200
  609.         0
  610.         0
  611.         12240
  612.         1440
  613.         0
  614.         1
  615.         3
  616.         1 0 0 0 0 0 0
  617.         0
  618.         0
  619.         1
  620.     [frmlay]
  621.         1440
  622.         12240
  623.         1
  624.         1440
  625.         72
  626.         1
  627.         792
  628.         1440
  629.         0
  630.         1
  631.         0
  632.         1
  633.         1
  634.         0
  635.         1
  636.         1440
  637.         10800
  638.         2
  639.         2
  640.         4680
  641.         3
  642.         9360
  643.     [txt]
  644. Peyton McManus
  645.  
  646. Lotus WPD
  647.  
  648. >
  649.     [frght]
  650.     [lyfrm]
  651.         1
  652.         13248
  653.         0
  654.         14400
  655.         12240
  656.         15840
  657.         0
  658.         1
  659.         3
  660.         1 0 0 0 0 0 0
  661.         0
  662.         0
  663.         2
  664.     [frmlay]
  665.         15840
  666.         12240
  667.         1
  668.         1440
  669.         792
  670.         1
  671.         14472
  672.         1440
  673.         0
  674.         1
  675.         0
  676.         1
  677.         1
  678.         0
  679.         1
  680.         1440
  681.         10800
  682.         2
  683.         2
  684.         4680
  685.         3
  686.         9360
  687.     [txt]
  688. >
  689. [elay]
  690. [l1]
  691.     0
  692. [edoc]
  693. <:#284,9360>
  694.  
  695. <:#284,9360>
  696.  
  697. <:#284,9360><:f,,>
  698.  
  699. <:#284,9360>define IsOKToRun(menuname)    GetInfo(217, 24, %1);
  700.  
  701. <:#284,9360>
  702.  
  703. <:#284,9360>' Text for the dialog box
  704.  
  705. <:#284,9360>Define    cText        "Each value's percentage of the total is listed next to each value."
  706.  
  707. <:#284,9360>
  708.  
  709. <:#284,9360>' How we display numbers in the dlg
  710.  
  711. <:#284,9360>Define    Decimals    2
  712.  
  713. <:#284,9360>Define    Prefix    "("
  714.  
  715. <:#284,9360>Define    Suffix    ""
  716.  
  717. <:#284,9360>
  718.  
  719. <:#284,9360>
  720.  
  721. <:#284,9360>' Dlg Defines
  722.  
  723. <:#284,9360>Define    Copybutton    40
  724.  
  725. <:#284,9360>Define    Databutton    41
  726.  
  727. <:#284,9360>
  728.  
  729. <:#284,9360>
  730.  
  731. <:#284,9360>' Win API Defines
  732.  
  733. @Outline2@<:#568,9360>Define    MyGetDlgItemText(hdg, id, string, max)    DllCall("User,GetDlgItemText,HHHCH",%1,%2,%3,%4)
  734.  
  735. <:#284,9360>define    CloseDlg(id)    dllcall("user,PostMessage,HHHHHH", HDLG, 0X111, %1, 0, 0).
  736.  
  737. <:#284,9360>Define    EnableWindow()    DllCall("User,EnableWindow,AHA",%1,%2)
  738.  
  739. @defines@<:#568,9360>DEFINE     SendMessage(hwnd, message, wparam, lparam)    DllCall("user,SendMessage,HHHHC",%1,%2,%3,%4)
  740.  
  741. @defines@<:#284,9360>
  742.  
  743. <:#284,9360>Define    WM_SETREDRAW    0x000B
  744.  
  745. <:#284,9360>define     LB_INSERTSTRING    1026    
  746.  
  747. <:#284,9360>define    LB_RESETCONTENT 1029
  748.  
  749. <:#284,9360>Define    WM_USER      1024
  750.  
  751. <:#284,9360>Define    LB_SetTabStops     WM_User+19
  752.  
  753. <:#568,9360>Define     SendMessageArray(hwnd, message, wparam, lparao) DllCall("user,SendMessage,JHHHN", %1, %2, %3, %4)
  754.  
  755. @Outline2@<:#284,9360>define LB_GETCOUNT    1036
  756.  
  757. @Outline2@<:#284,9360>define LB_GETTEXT        1034
  758.  
  759. @Outline2@<:#284,9360>define LB_SETCURSEL    1031
  760.  
  761. @Outline2@<:#284,9360>
  762.  
  763. <:#284,9360>
  764.  
  765. <:#284,9360>
  766.  
  767. @Outline2@<:#284,9360>
  768.  
  769. <:#284,9360>Declare FindAndReplace(String, FindWhat, ReplaceWhat)
  770.  
  771. <:#284,9360>Declare BuildNumberList(Val, aNumbers, List)
  772.  
  773. <:#284,9360>Declare DisplayBox(List)
  774.  
  775. <:#284,9360>Declare DataDlg(Hdlg, id, value)
  776.  
  777. <:#284,9360>Declare FontDlg(Action, Hdlg, Id)
  778.  
  779. <:#284,9360>
  780.  
  781. @Subhead@<:#284,9360>Function Main()
  782.  
  783. <:#284,9360>DefStr Stat, List, hInstance;
  784.  
  785. <:#284,9360>Mac = GetRunningMacroFile$()
  786.  
  787. <:#284,9360>If IsOKToRun(Copy)
  788.  
  789. <:#284,9360>    If IsFrameSelected()
  790.  
  791. <:#284,9360>        ' don't copy if a frame is selected
  792.  
  793. <:#284,9360>    Else
  794.  
  795. <:#284,9360>        Copy()
  796.  
  797. <:#284,9360>    Endif
  798.  
  799. <:#284,9360>Else
  800.  
  801. <:#284,9360>    ClipBoardWrite("",1)
  802.  
  803. <:#284,9360>Endif
  804.  
  805. <:#284,9360>FillEdit(1000,cText)
  806.  
  807. <:#284,9360>FontDlg(1,0,0)
  808.  
  809. <:#284,9360>SetDlgCallBack(0,"{Mac}!InitDlg")
  810.  
  811. <:#284,9360>SetDlgCallBack(Databutton,"{Mac}!DataBox")
  812.  
  813. <:#284,9360>SetDlgCallBack(Copybutton,"{Mac}!CopyData")
  814.  
  815. @Outline3@<:#284,9360>DlgKeyInterrupt(112, "{mac}!DisplayHelp")
  816.  
  817. @Outline3@<:#284,9360>
  818.  
  819. <:#284,9360>Box = DialogBox(".","QkPercen")
  820.  
  821. <:#284,9360>FontDlg(4,0,0)
  822.  
  823. <:#284,9360>End Function
  824.  
  825. <:#284,9360>
  826.  
  827. @Subhead@<:#284,9360>Function FindAndReplace(String, Findwhat, Replacewith)
  828.  
  829. <:#284,9360>DefStr Location;
  830.  
  831. <:#284,9360>OffSet = 0
  832.  
  833. <:#284,9360>While 0 != Assign(&Location, Instr(OffSet, String, FindWhat))
  834.  
  835. <:#284,9360>    BeforeLocation = Left$(String, Location - 1)
  836.  
  837. <:#284,9360>    AfterLocation = Right$(String, Len(String) - Location);
  838.  
  839. <:#284,9360>    *String = StrCat$(BeforeLocation, ReplaceWith, AfterLocation)
  840.  
  841. <:#284,9360>Wend
  842.  
  843. <:#284,9360>End Function
  844.  
  845. <:#284,9360>
  846.  
  847. @Subhead@<:#284,9360>Function BuildNumberList(Val, aNumbers, List)
  848.  
  849. ' This function takes a string separated with spaces and creates a numeric list of values sep with a ,
  850.  
  851. DefStr Value, Location;
  852.  
  853. sList = GetProfileString$("Intl","sList","Win.Ini")
  854.  
  855. Val = StrCat$(Val," ")    ' put a space at the end
  856.  
  857. x = 1
  858.  
  859. OffSet = 0
  860.  
  861. Count = 1
  862.  
  863. While 0 != Assign(&Location, Instr(OffSet, Val, " "))
  864.  
  865.     Value =  StrField$(Val, x, " ")
  866.  
  867.     If IsNumeric(Value)
  868.  
  869.         If count = 1
  870.  
  871.             TempList = "{Value}"        
  872.  
  873.         Else
  874.  
  875.             TempList = StrCat$(TempList,"{sList}",Value)
  876.  
  877.         Endif
  878.  
  879.         Total = Total + Value
  880.  
  881.         ArrayInsert(&aNumbers, Count, Value)
  882.  
  883.         Count = Count + 1
  884.  
  885.     Endif
  886.  
  887.     x = x + 1
  888.  
  889.     OffSet = Location + 1
  890.  
  891. Wend
  892.  
  893. *List = TempList
  894.  
  895. Return Total;
  896.  
  897. End Function
  898.  
  899.  
  900. <:#284,9360>
  901.  
  902. @Subhead@<:#284,9360>Function InitDlg(Hdlg, id, value)
  903.  
  904. <:#284,9360>IgnoreKeyBoard(2)
  905.  
  906. <:#284,9360>HourGlass(on)
  907.  
  908. <:#284,9360>DefStr Stat;
  909.  
  910. <:#284,9360>Dim Tab(2)
  911.  
  912. <:#284,9360>Tab(1)=20
  913.  
  914. <:#284,9360>Tab(2)=40
  915.  
  916. <:#284,9360>HList = GetDlgItem(Hdlg, 9000)
  917.  
  918. <:#284,9360>If 0= Assign(&Stat, SendMessageArray(HList, LB_SetTabStops, 4, &Tab))
  919.  
  920. <:#284,9360>Else
  921.  
  922. <:#284,9360>    Message(Stat)
  923.  
  924. <:#284,9360>Endif
  925.  
  926. <:#284,9360>FontDlg(3,Hdlg, 9000)
  927.  
  928. <:#284,9360>FontDlg(3,Hdlg, 1000)
  929.  
  930. <:#284,9360>FontDlg(3,Hdlg, 1001)
  931.  
  932. <:#284,9360>FontDlg(3,hDlg, 1002)
  933.  
  934. <:#284,9360>DataDlg(Hdlg, id, value)
  935.  
  936. <:#284,9360>HourGlass(off)
  937.  
  938. <:#284,9360>end function
  939.  
  940. <:#284,9360>
  941.  
  942. <:#284,9360>
  943.  
  944. @Subhead@<:#284,9360>Function DataDlg(Hdlg, id, value)
  945.  
  946. <:#284,9360>IgnoreKeyBoard(2)
  947.  
  948. <:#284,9360>DefStr Sum, Avg, Median, Max, Min, hInstance, List;
  949.  
  950. <:#284,9360>' Turn dlg paint off
  951.  
  952. <:#284,9360>HourGlass(on)
  953.  
  954. <:#284,9360>hListBox = GetDlgItem(Hdlg, 9000)
  955.  
  956. <:#284,9360>SendMessage(hListBox, WM_SETREDRAW,0,"")
  957.  
  958. <:#284,9360>AppSendMessage(hLIstBox, LB_RESETCONTENT,"","")
  959.  
  960. <:#284,9360>Dim aNumbers(1)
  961.  
  962. <:#284,9360>val = ClipBoardRead(1)
  963.  
  964. <:#284,9360>
  965.  
  966. <:#284,9360>FindAndReplace(&Val, "    ", " ")        ' Convert tab to space
  967.  
  968. <:#284,9360>FindAndReplace(&Val, Chr$(10)," ")
  969.  
  970. <:#284,9360>FindAndReplace(&Val, Chr$(13)," ")
  971.  
  972. <:#284,9360>FindAndReplace(&Val, "$","")            ' Remove $ sign
  973.  
  974. <:#284,9360>FindAndReplace(&Val, ",","")            ' Remove Commas
  975.  
  976. <:#284,9360>Total = BuildNumberList(Val, &aNumbers, &List) 
  977.  
  978. <:#284,9360>SetDlgItemText(Hdlg, 1002, Total)
  979.  
  980. <:#284,9360>Size = ArraySize(&aNumbers)
  981.  
  982. <:#284,9360>For t = 1 to Size
  983.  
  984. <:#284,9360>    Number = aNumbers(t)
  985.  
  986. <:#284,9360>    If Total != "" 
  987.  
  988. <:#284,9360>        PercentTotal = 100 * (Number/Total)
  989.  
  990. <:#284,9360>        FormattedNum = FormatNum$(Prefix, Suffix, Decimals, PercentTotal)
  991.  
  992. <:#284,9360>        FormattedNum = StrCat$(FormattedNum, Chr$(37),")")
  993.  
  994. <:#284,9360>        tabString = BracketsToBin(StrCat$(Number,"<[>Tab]",FormattedNum))
  995.  
  996. <:#284,9360>        SendMessage(hListBox, LB_InsertString, -1, TabString)
  997.  
  998. <:#284,9360>        Count = Count + 1
  999.  
  1000. <:#284,9360>    Endif
  1001.  
  1002. <:#284,9360>Next
  1003.  
  1004. <:#284,9360>SendMessage(hListBox, WM_SETREDRAW,1,"")
  1005.  
  1006. <:#284,9360>If  Count <;> 0
  1007.  
  1008. <:#284,9360>    EnableWindow(GetDlgItem(Hdlg, CopyButton),1)
  1009.  
  1010. <:#284,9360>Else
  1011.  
  1012. <:#284,9360>    ' grey the copy button
  1013.  
  1014. <:#284,9360>    EnableWindow(GetDlgItem(Hdlg, Copybutton),0)
  1015.  
  1016. <:#284,9360>
  1017.  
  1018. <:#284,9360>Endif    
  1019.  
  1020. <:#284,9360>
  1021.  
  1022. <:#284,9360>
  1023.  
  1024. <:#284,9360>HourGlass(off)
  1025.  
  1026. <:#284,9360>End Function
  1027.  
  1028. <:#284,9360>
  1029.  
  1030. <:#284,9360>
  1031.  
  1032. @Subhead@<:#284,9360>function DisplayHelp()
  1033.  
  1034. @Outline2@<:#284,9360>' two defines needed for help.  The help name and panel number are defined above
  1035.  
  1036. @Outline2@<:#284,9360>define FindWindowa() DllCall("user,FindWindow,HCC", %1, %2)
  1037.  
  1038. @Outline2@<:#284,9360>define WinHelpa(hWnd, file, cmd, ptr)    DllCall("user,WinHelp,HHCHJ", %1, %2, %3, %4)
  1039.  
  1040. @Outline2@<:#284,9360>prohWnd = FindWindowa("AmiProWndA", 0)
  1041.  
  1042. @Outline2@<:#284,9360>helpfile = strcat$(GetAmiDirectory$(), "HelpPack.hlp")
  1043.  
  1044. @Outline2@<:#284,9360>PanelNum= 60 
  1045.  
  1046. @Outline2@<:#284,9360>WinHelpa(prohWnd, helpfile, 0x0001, Panelnum)
  1047.  
  1048. @Outline2@<:#284,9360>end function
  1049.  
  1050. @Subhead@<:#284,9360>
  1051.  
  1052. <:#284,9360>
  1053.  
  1054. <:#284,9360>
  1055.  
  1056. <:#284,9360>
  1057.  
  1058. @Subhead@<:#284,9360>FUnction CopyData(Hdlg, Id, value)
  1059.  
  1060. <:#284,9360>'ClipBoardWrite(Data,1)
  1061.  
  1062. @Outline2@<:#284,9360>hListbox = GetDlgItem(Hdlg, 9000)
  1063.  
  1064. <:#284,9360>SendMessage(hListBox, WM_SETREDRAW,0,"")
  1065.  
  1066. @Outline2@<:#284,9360>count = AppSendMessage (hListbox, LB_GETCOUNT, 0, 0) 
  1067.  
  1068. @Outline2@<:#284,9360>for i=1 to count
  1069.  
  1070. @Outline2@<:#284,9360>    AppSendMessage(hListbox, LB_SETCURSEL, i - 1, 0)
  1071.  
  1072. @Outline2@<:#284,9360>    Item = GetDlgItemText(Hdlg, 9000)
  1073.  
  1074. @Outline2@<:#284,9360>    If Item != ""
  1075.  
  1076. @Outline2@<:#284,9360>'        Stuff = StrCat$(Stuff, "    ",Item,"<[>Enter]<[>0x0A]")
  1077.  
  1078. @Outline2@<:#284,9360>        Stuff = StrCat$(Stuff,Item,"<[>Enter]<[>0x0A]")
  1079.  
  1080. @Outline2@<:#284,9360>
  1081.  
  1082. @Outline2@<:#284,9360>    Endif
  1083.  
  1084. @Outline2@<:#284,9360>next
  1085.  
  1086. <:#284,9360>Stuff=BracketsToBin(Stuff)
  1087.  
  1088. <:#284,9360>
  1089.  
  1090. @Outline2@<:#284,9360>'If Stuff != ""
  1091.  
  1092. @Outline2@<:#284,9360>'    Stuff = Right$(Stuff, Len(Stuff) - 1)
  1093.  
  1094. @Outline2@<:#284,9360>'Endif
  1095.  
  1096. <:#284,9360>SendMessage(hListBox, WM_SETREDRAW,1,"")
  1097.  
  1098. <:#284,9360>ClipBoardWrite(Stuff,1)
  1099.  
  1100. <:#284,9360>CloseDlg(2)
  1101.  
  1102. <:#284,9360>End Function
  1103.  
  1104. <:#284,9360>
  1105.  
  1106. <:#284,9360>
  1107.  
  1108. <:#284,9360>
  1109.  
  1110. <:#284,9360>
  1111.  
  1112. @Subhead@<:#284,9360>Function DataBox(Hdlg, Id, Value)
  1113.  
  1114. <:#284,9360>Mac = GetRunningMacroFile$()
  1115.  
  1116. <:#284,9360>Value = ClipBoardRead(1)
  1117.  
  1118. <:#284,9360>Filledit(8000,Value)
  1119.  
  1120. @Outline3@<:#284,9360>DlgKeyInterrupt(112, "{mac}!DisplayHelp")
  1121.  
  1122. @Outline3@<:#284,9360>
  1123.  
  1124. <:#284,9360>Box = Dialogbox(".","Data")
  1125.  
  1126. <:#284,9360>If Box <<<;>1
  1127.  
  1128. <:#284,9360>    Return 0
  1129.  
  1130. <:#284,9360>Endif
  1131.  
  1132. <:#284,9360>Data = GetDialogField$(8000)
  1133.  
  1134. <:#284,9360>ClipBoardWrite(Data,1)
  1135.  
  1136. <:#284,9360>DataDlg(Hdlg, id, value)
  1137.  
  1138. <:#284,9360>End Function
  1139.  
  1140. <:#284,9360>
  1141.  
  1142. @Subhead@<:#284,9360>Function FontDlg(Action, Hdlg, id)
  1143.  
  1144. <:#284,9360>' 1    Create a font and allocvar
  1145.  
  1146. <:#284,9360>' 2    Return the handle of the create font 
  1147.  
  1148. <:#284,9360>' 3    Set the id specified to the font
  1149.  
  1150. <:#284,9360>' 4    Freeglobalvar and delete created object
  1151.  
  1152. <:#284,9360>
  1153.  
  1154. @Outline2@<:#568,9360>define    CreateFontDLG()        DllCall("gdi,CreateFont,HHHHHHHHHHHHHHC", %1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14)
  1155.  
  1156. @Outline2@<:#284,9360>define    DeleteObjectDLG(handle)    DllCall("gdi,DeleteObject,HH", %1)
  1157.  
  1158. @Outline2@<:#568,9360>define    SendMessageDLG(hwnd, msg, wpara, lparm)    DllCall("user,SendMessage,HHHHJ", %1, %2, %3, %4)
  1159.  
  1160. @Outline2@<:#284,9360>
  1161.  
  1162. @Outline2@<:#284,9360>
  1163.  
  1164. <:#284,9360>Switch Action
  1165.  
  1166. <:#284,9360>    Case 1    ' Create the font and store it
  1167.  
  1168. @Outline2@<:#284,9360>        Font = CreateFontDLG(13, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv")
  1169.  
  1170. <:#284,9360>        AllocGlobalVar("FontHandle",1)
  1171.  
  1172. <:#284,9360>        If Font
  1173.  
  1174. <:#284,9360>            SetGlobalVar("FontHandle",Font)
  1175.  
  1176. <:#284,9360>            Return Font
  1177.  
  1178. <:#284,9360>        Else
  1179.  
  1180. <:#284,9360>            Return 0;    ' no font
  1181.  
  1182. <:#284,9360>        Endif
  1183.  
  1184. <:#284,9360>        Break;
  1185.  
  1186. <:#284,9360>    Case 2    ' Return the handle to the font
  1187.  
  1188. <:#284,9360>        Handle = GetGlobalVar$("FontHandle")
  1189.  
  1190. <:#284,9360>        If Handle 
  1191.  
  1192. <:#284,9360>            Return Handle
  1193.  
  1194. <:#284,9360>        Else
  1195.  
  1196. <:#284,9360>            Return 0
  1197.  
  1198. <:#284,9360>        Endif
  1199.  
  1200. <:#284,9360>
  1201.  
  1202. <:#284,9360>    Case 3    ' Set the id to the font
  1203.  
  1204. <:#284,9360>        Handle = GetGlobalVar$("FontHandle")
  1205.  
  1206. <:#284,9360>        If Handle 
  1207.  
  1208. <:#284,9360>            IdControl = GetDlgITem(Hdlg, id)
  1209.  
  1210. <:#284,9360>            SendMessageDlg(idControl, 0x30, Handle, 0)
  1211.  
  1212. <:#284,9360>            Return 1
  1213.  
  1214. <:#284,9360>        Else
  1215.  
  1216. <:#284,9360>            Return 0
  1217.  
  1218. <:#284,9360>        Endif
  1219.  
  1220. <:#284,9360>        Break;        
  1221.  
  1222. <:#284,9360>        
  1223.  
  1224. <:#284,9360>    Case 4    ' Delete the font and clear the var
  1225.  
  1226. <:#284,9360>        Handle = GetGlobalVar$("FontHandle")
  1227.  
  1228. <:#284,9360>        If Handle
  1229.  
  1230. <:#284,9360>            DeleteObjectDLG(Handle)
  1231.  
  1232. <:#284,9360>            Stat = 1    
  1233.  
  1234. <:#284,9360>        Else
  1235.  
  1236. <:#284,9360>            Stat = 0
  1237.  
  1238. <:#284,9360>        Endif
  1239.  
  1240. <:#284,9360>        FreeGlobalVar("FontHandle")
  1241.  
  1242. <:#284,9360>        Return Stat        
  1243.  
  1244. <:#284,9360>    Default
  1245.  
  1246. <:#284,9360>        Message("Fontdlg received an invalid parameter {Action}")
  1247.  
  1248. <:#284,9360>EndSwitch    
  1249.  
  1250. <:#284,9360>
  1251.  
  1252. <:#284,9360>End Function
  1253.  
  1254. @Subhead@<:#284,9360>
  1255.  
  1256. <:#284,9360>
  1257.  
  1258. <:#284,9360>
  1259.  
  1260. <:#284,9360>
  1261.  
  1262. <:#284,9360>
  1263.  
  1264. <:#284,9360>
  1265.  
  1266. <:#284,9360>DIALOG    Qkpercen
  1267.  
  1268. <:#284,9360>-2134376448    7    69    32    147    82    ""    "AmiDialog"    "Quick%"
  1269.  
  1270. <:#284,9360>FONT    8    "Helv"
  1271.  
  1272. <:#284,9360>103    2    40    14    1    1342373889    "button"    "Done"    0 
  1273.  
  1274. <:#284,9360>103    18    40    14    40    1342373888    "button"    "Copy All"    0 
  1275.  
  1276. <:#284,9360>103    34    40    14    41    1342373888    "button"    "&Data..."    0 
  1277.  
  1278. <:#284,9360>5    2    89    23    1000    1342177280    "static"    "text"    0 
  1279.  
  1280. <:#284,9360>5    21    92    58    9000    1352728705    "listbox"    ""    0 
  1281.  
  1282. <:#284,9360>100    71    18    8    1001    1342177280    "static"    "Sum:"    0 
  1283.  
  1284. <:#284,9360>116    71    28    8    1002    1342177282    "static"    "text"    0 
  1285.  
  1286. <:#284,9360>END DIALOG
  1287.  
  1288. <:#284,9360>
  1289.  
  1290. <:#284,9360>
  1291.  
  1292. <:#284,9360>
  1293.  
  1294. <:#284,9360>
  1295.  
  1296. <:#284,9360>DIALOG    Data
  1297.  
  1298. <:#284,9360>-2134376448    4    80    51    207    107    ""    "AmiDialog"    "Data"
  1299.  
  1300. <:#284,9360>FONT    8    "Helv"
  1301.  
  1302. <:#284,9360>6    6    156    96    8000    1350631492    "edit"    ""    0 
  1303.  
  1304. <:#284,9360>164    4    40    14    1    1342373889    "button"    "OK"    0 
  1305.  
  1306. <:#284,9360>164    21    40    14    2    1342373888    "button"    "Cancel"    0 
  1307.  
  1308. <:#284,9360>163    49    40    27    1000    1342177281    "static"    "CTRL + M for a new line"    0 
  1309.  
  1310. <:#284,9360>END DIALOG
  1311.  
  1312. >
  1313.  
  1314. [Embedded]
  1315. 00016996
  1316. >
  1317. [macsum] 11
  1318. Main 0 0 6 44
  1319. FindAndReplace 388 3 5 67
  1320. BuildNumberList 640 3 9 77
  1321. InitDlg 1133 3 4 105
  1322. DataDlg 1506 3 19 126
  1323. DisplayHelp 2555 0 4 170
  1324. CopyData 2740 3 6 183
  1325. DataBox 3234 3 4 210
  1326. FontDlg 3471 3 5 225
  1327. Qkpercen 4317 0 -1 287
  1328. Data 4736 0 -1 302
  1329. [macse]
  1330. 14 Main
  1331. 0 802
  1332. 13
  1333. 8 4
  1334. 0 1313 217 24 154
  1335. 13
  1336. 11 00000120
  1337. 0 800
  1338. 13
  1339. 11 00000098
  1340. 10 00000107
  1341. 2 154 1
  1342. 10 00000133
  1343. 0 1038 "" 1
  1344. 0 31 1000 "Each value's percentage of the total is listed next to each value."
  1345. 16 FontDlg 1 0 0
  1346. 0 41 0 "{4}!InitDlg"
  1347. 0 41 41 "{4}!DataBox"
  1348. 0 41 40 "{4}!CopyData"
  1349. 0 47 112 "{4}!DisplayHelp"
  1350. 0 26 "." "QkPercen"
  1351. 13
  1352. 8 5
  1353. 16 FontDlg 4 0 0
  1354. 6 0
  1355. 15
  1356. 9
  1357. 14 FindAndReplace
  1358. 5 0
  1359. 8 5
  1360. 5 0
  1361. 0 808 "{5}" "{0}" "{1}"
  1362. 13
  1363. 0 805 &4 [X]
  1364. 13
  1365. 18 1
  1366. 11 00000240
  1367. 6 4
  1368. 5 1
  1369. 3 1
  1370. 0 806 "{0}" [X]
  1371. 13
  1372. 8 6
  1373. 0 14 "{0}"
  1374. 13
  1375. 6 4
  1376. 3 1
  1377. 0 807 "{0}" [X]
  1378. 13
  1379. 8 7
  1380. 0 16 "{6}" "{2}" "{7}"
  1381. 13
  1382. 28 0
  1383. 10 00000029
  1384. 6 3
  1385. 15
  1386. 9
  1387. 14 BuildNumberList
  1388. 0 286 "Intl" "sList" "Win.Ini"
  1389. 13
  1390. 8 6
  1391. 0 16 "{0}" " "
  1392. 13
  1393. 8 0
  1394. 5 1
  1395. 8 7
  1396. 5 0
  1397. 8 8
  1398. 5 1
  1399. 8 9
  1400. 5 0
  1401. 0 808 "{8}" "{0}" " "
  1402. 13
  1403. 0 805 &5 [X]
  1404. 13
  1405. 18 1
  1406. 11 00000456
  1407. 0 20 "{0}" "{7}" " "
  1408. 13
  1409. 8 4
  1410. 0 277 "{4}"
  1411. 13
  1412. 11 00000403
  1413. 6 9
  1414. 5 1
  1415. 18 0
  1416. 11 00000303
  1417. 7 "{4}"
  1418. 8 10
  1419. 10 00000338
  1420. 0 16 "{10}" "{6}" "{4}"
  1421. 13
  1422. 8 10
  1423. 6 11
  1424. 6 4
  1425. 3 0
  1426. 8 11
  1427. 0 1041 &1 "{9}" "{4}"
  1428. 6 9
  1429. 5 1
  1430. 3 0
  1431. 8 9
  1432. 6 7
  1433. 5 1
  1434. 3 0
  1435. 8 7
  1436. 6 5
  1437. 5 1
  1438. 3 0
  1439. 8 8
  1440. 10 00000116
  1441. 6 10
  1442. 28 2
  1443. 6 11
  1444. 15
  1445. 9
  1446. 6 3
  1447. 15
  1448. 9
  1449. 14 InitDlg
  1450. 0 32 2
  1451. 0 296 1
  1452. 5 2
  1453. 21 5 [X]
  1454. 5 1
  1455. 5 20
  1456. 23 5
  1457. 5 2
  1458. 5 40
  1459. 23 5
  1460. 0 44 "{0}" 9000
  1461. 13
  1462. 8 6
  1463. 5 0
  1464. 0 284 "user,SendMessage,JHHHN" "{6}" 1024 4 &5
  1465. 13
  1466. 0 805 &4 [X]
  1467. 13
  1468. 18 0
  1469. 11 00000211
  1470. 10 00000222
  1471. 0 3 "{4}"
  1472. 16 FontDlg 3 "{0}" 9000
  1473. 16 FontDlg 3 "{0}" 1000
  1474. 16 FontDlg 3 "{0}" 1001
  1475. 16 FontDlg 3 "{0}" 1002
  1476. 16 DataDlg "{0}" "{1}" "{2}"
  1477. 0 296 0
  1478. 6 3
  1479. 15
  1480. 9
  1481. 14 DataDlg
  1482. 0 32 2
  1483. 0 296 1
  1484. 0 44 "{0}" 9000
  1485. 13
  1486. 8 11
  1487. 0 284 "user,SendMessage,HHHHC" "{11}" 11 0 ""
  1488. 0 1036 "{11}" 1029 "" ""
  1489. 5 1
  1490. 21 12 [X]
  1491. 0 1037 1
  1492. 13
  1493. 8 13
  1494. 16 FindAndReplace &13 "    " " "
  1495. 0 39 10
  1496. 13
  1497. 16 FindAndReplace &13 [X] " "
  1498. 0 39 13
  1499. 13
  1500. 16 FindAndReplace &13 [X] " "
  1501. 16 FindAndReplace &13 "$" ""
  1502. 16 FindAndReplace &13 "," ""
  1503. 16 BuildNumberList "{13}" &12 &10
  1504. 13
  1505. 8 14
  1506. 0 43 "{0}" 1002 "{14}"
  1507. 0 1046 &12
  1508. 13
  1509. 8 15
  1510. 5 1
  1511. 8 16
  1512. 6 15
  1513. 6 16
  1514. 18 2
  1515. 12 00000525
  1516. 10 00000826
  1517. 5 1
  1518. 6 16
  1519. 3 0
  1520. 8 16
  1521. 10 00000446
  1522. 6 16
  1523. 22 12
  1524. 8 17
  1525. 6 14
  1526. 7 ""
  1527. 18 1
  1528. 11 00000813
  1529. 5 100
  1530. 6 17
  1531. 6 14
  1532. 4 1
  1533. 4 0
  1534. 8 18
  1535. 0 19 "(" "" 2 "{18}"
  1536. 13
  1537. 8 19
  1538. 0 39 37
  1539. 13
  1540. 0 16 "{19}" [X] ")"
  1541. 13
  1542. 8 19
  1543. 0 16 "{17}" "[9]" "{19}"
  1544. 13
  1545. 0 784 [X]
  1546. 13
  1547. 8 20
  1548. 0 284 "user,SendMessage,HHHHC" "{11}" 1026 -1 "{20}"
  1549. 6 21
  1550. 5 1
  1551. 3 0
  1552. 8 21
  1553. 10 00000490
  1554. 0 284 "user,SendMessage,HHHHC" "{11}" 11 1 ""
  1555. 6 21
  1556. 5 0
  1557. 18 3
  1558. 11 00000972
  1559. 0 44 "{0}" 40
  1560. 13
  1561. 0 284 "User,EnableWindow,AHA" [X] 1
  1562. 10 00001028
  1563. 0 44 "{0}" 40
  1564. 13
  1565. 0 284 "User,EnableWindow,AHA" [X] 0
  1566. 0 296 0
  1567. 6 3
  1568. 15
  1569. 9
  1570. 14 DisplayHelp
  1571. 0 284 "user,FindWindow,HCC" "AmiProWndA" 0
  1572. 13
  1573. 8 1
  1574. 0 798
  1575. 13
  1576. 0 16 [X] "HelpPack.hlp"
  1577. 13
  1578. 8 2
  1579. 5 60
  1580. 8 3
  1581. 0 284 "user,WinHelp,HHCHJ" "{1}" "{2}" 1 "{3}"
  1582. 6 0
  1583. 15
  1584. 9
  1585. 14 CopyData
  1586. 0 44 "{0}" 9000
  1587. 13
  1588. 8 4
  1589. 0 284 "user,SendMessage,HHHHC" "{4}" 11 0 ""
  1590. 0 1036 "{4}" 1036 0 0
  1591. 13
  1592. 8 5
  1593. 5 1
  1594. 8 6
  1595. 6 5
  1596. 6 6
  1597. 18 2
  1598. 12 00000202
  1599. 10 00000349
  1600. 5 1
  1601. 6 6
  1602. 3 0
  1603. 8 6
  1604. 10 00000127
  1605. 6 6
  1606. 5 1
  1607. 3 1
  1608. 0 1036 "{4}" 1031 [X] 0
  1609. 0 42 "{0}" 9000
  1610. 13
  1611. 8 7
  1612. 6 7
  1613. 7 ""
  1614. 18 1
  1615. 11 00000336
  1616. 0 16 "{8}" "{7}" "[13][10]"
  1617. 13
  1618. 8 8
  1619. 10 00000169
  1620. 0 784 "{8}"
  1621. 13
  1622. 8 8
  1623. 0 284 "user,SendMessage,HHHHC" "{4}" 11 1 ""
  1624. 0 1038 "{8}" 1
  1625. 0 284 "user,PostMessage,HHHHHH" "{0}" 273 2 0 0
  1626. 6 3
  1627. 15
  1628. 9
  1629. 14 DataBox
  1630. 0 802
  1631. 13
  1632. 8 4
  1633. 0 1037 1
  1634. 13
  1635. 8 2
  1636. 0 31 8000 "{2}"
  1637. 0 47 112 "{4}!DisplayHelp"
  1638. 0 26 "." "Data"
  1639. 13
  1640. 8 5
  1641. 6 5
  1642. 5 1
  1643. 18 1
  1644. 11 00000159
  1645. 5 0
  1646. 15
  1647. 9
  1648. 0 27 8000
  1649. 13
  1650. 8 6
  1651. 0 1038 "{6}" 1
  1652. 16 DataDlg "{0}" "{1}" "{2}"
  1653. 6 3
  1654. 15
  1655. 9
  1656. 14 FontDlg
  1657. 5 1
  1658. 6 0
  1659. 18 0
  1660. 11 00000255
  1661. 0 284 "gdi,CreateFont,HHHHHHHHHHHHHHC" 13 0 0 0 400 0 0 0 0 0 0 0 0 "Helv"
  1662. 13
  1663. 8 4
  1664. 0 271 "FontHandle" 1
  1665. 6 4
  1666. 11 00000217
  1667. 0 264 "FontHandle" "{4}"
  1668. 6 4
  1669. 15
  1670. 9
  1671. 10 00000229
  1672. 5 0
  1673. 15
  1674. 9
  1675. 10 00000834
  1676. 10 00000834
  1677. 5 2
  1678. 6 0
  1679. 18 0
  1680. 11 00000381
  1681. 0 265 "FontHandle"
  1682. 13
  1683. 8 5
  1684. 6 5
  1685. 11 00000356
  1686. 6 5
  1687. 15
  1688. 9
  1689. 10 00000368
  1690. 5 0
  1691. 15
  1692. 9
  1693. 10 00000834
  1694. 5 3
  1695. 6 0
  1696. 18 0
  1697. 11 00000596
  1698. 0 265 "FontHandle"
  1699. 13
  1700. 8 5
  1701. 6 5
  1702. 11 00000558
  1703. 0 44 "{1}" "{2}"
  1704. 13
  1705. 8 6
  1706. 0 284 "user,SendMessage,HHHHJ" "{6}" 48 "{5}" 0
  1707. 5 1
  1708. 15
  1709. 9
  1710. 10 00000570
  1711. 5 0
  1712. 15
  1713. 9
  1714. 10 00000834
  1715. 10 00000834
  1716. 5 4
  1717. 6 0
  1718. 18 0
  1719. 11 00000785
  1720. 0 265 "FontHandle"
  1721. 13
  1722. 8 5
  1723. 6 5
  1724. 11 00000730
  1725. 0 284 "gdi,DeleteObject,HH" "{5}"
  1726. 5 1
  1727. 8 7
  1728. 10 00000740
  1729. 5 0
  1730. 8 7
  1731. 0 266 "FontHandle"
  1732. 6 7
  1733. 15
  1734. 9
  1735. 10 00000834
  1736. 0 3 "Fontdlg received an invalid parameter {0}"
  1737. 6 3
  1738. 15
  1739. 9
  1740. DIALOG Qkpercen
  1741. -2134376448 7 69 32 147 82 "" "AmiDialog" "Quick%" 
  1742. FONT 8 "Helv" 
  1743. 103 2 40 14 1 1342373889 "button" "Done" 0 
  1744. 103 18 40 14 40 1342373888 "button" "Copy All" 0 
  1745. 103 34 40 14 41 1342373888 "button" "&Data..." 0 
  1746. 5 2 89 23 1000 1342177280 "static" "text" 0 
  1747. 5 21 92 58 9000 1352728705 "listbox" "" 0 
  1748. 100 71 18 8 1001 1342177280 "static" "Sum:" 0 
  1749. 116 71 28 8 1002 1342177282 "static" "text" 0 
  1750. DIALOG Data
  1751. -2134376448 4 80 51 207 107 "" "AmiDialog" "Data" 
  1752. FONT 8 "Helv" 
  1753. 6 6 156 96 8000 1350631492 "edit" "" 0 
  1754. 164 4 40 14 1 1342373889 "button" "OK" 0 
  1755. 164 21 40 14 2 1342373888 "button" "Cancel" 0 
  1756. 163 49 40 27 1000 1342177281 "static" "CTRL + M for a new line" 0 
  1757. 00017021
  1758.